using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace FrameWork.AStar
{
    // 格子类标签，可走/障碍
    public enum AStar_Node_Type
    {
        Walk,
        Stop,
    }
    public class AStarNode
    {
        // 基本状态信息
        public int x;                         // 坐标X
        public int y;                         // 坐标Y
        public AStar_Node_Type type;          // 标签
        
        // A Star 使用
        public float f;                       // 寻路消耗
        public float g;                       // 离起点距离
        public float h;                       // 离终点距离
        public AStarNode parentNode;          // 父节点
        public float weight;                  // 权重
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="type"></param>
        public AStarNode(int x, int y, float weight, AStar_Node_Type type)
        {
            this.x = x;
            this.y = y;
            this.weight = weight;
            this.type = type;
        }
    }
}
